Out of order simultaneous multi-threading refers to a technique in which multiple threads are executing at the same time on a processor that is capable of speculative execution. Speculative execution refers to instances wherein instructions in a program are issued out of order according to their data dependencies but not necessarily according to their sequential appearance in the program. Thus, with speculative execution instructions may be executed “out of order.”
Instructions are typically executed with references to registers. The registers may hold operands for the instructions and may store results of operations. Out of order execution of instructions requires not only the preservation of conventional register states but also the preservation of register state for speculatively executed instructions. For example, if an instruction beyond a predicted branch in an instruction flow is issued out of order, the microprocessor must write the results of speculatively executing the instruction. However, if the branch was predicted incorrectly, the previous results stored in the register must be restored and the speculative results must be removed. Hence, simultaneous multi-threading that employs out of order execution requires the preservation of register state not only for general purpose registers for all threads but also for a speculative issue of instructions as well. As a result, simultaneous multithreading demands a large register file. A “register file” is an array of registers that may be addressed as a unit.
Conventional simultaneous multi-threading microprocessors employ of one of two approaches. In a first approach, a single register file may be shared amongst multiple threads. With this first approach, resource contention among threads for the register file may arise, and the use of the register file by one of the threads may detrimentally affect the use of the register file by another one of the threads. In a second approach, two “private” register files are provided. The second approach does not have resource contention problems, but when only one thread is active, half of the registers in the register files are unused.